<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#loginF").submit(function(event){
		
		$.ajax({
			type : "post",
			url : "${initParam.root}/login.do",
			data:$(this).serialize(),
			datatype:"json",
			success:function(data){
				
				if(data==false)
					{
						alert("로그인 실패!!");
					}
				else if(data==true)
					{
						alert("로그인 성공!!");
						 $('#mask , .login-popup').fadeOut(300 , function() {
						 $('#mask').remove(); 
						 location.href="${initParam.root }/main.do";
						 });
						
					}
				
				
				
			}
		});
		event.preventDefault();
	});//submit
	

	
});

</script>

</head>


<body>
<a href="#" class="close"><img src="image/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
<h1>로그인</h1>
  <form method="post" class="signin" id="loginF">
        <fieldset class="textbox">
        <label class="username">
        <span>User ID</span>
        <input id="username" name="id"  type="text" autocomplete="on" placeholder="User ID">
        </label>
        <label class="password">
        <span>Password</span>
        <input id="password" name="password" type="password" placeholder="Password">
        </label>
        <button class="submit button" type="submit">Login</button>
        <p>
        <a class="forgot" id="forgotid">Forgot your ID?</a>&nbsp;&nbsp;&nbsp;
        <a class="forgot" id="forgotpassword">Forgot your Password?</a>
        
        </p>        
        </fieldset>
  </form>

</body>
</html>